<template>
  <section class="jumbotron">
    <h3 class="jumbotron-heading">Search Github Users</h3>
    <div>
      <input type="text" placeholder="enter the name you search" v-model="searchName"/>
      <button @click="search">Search</button>
    </div>
  </section>
</template>

<script>
export default {
  data() {
    return {
      searchName: ''
    }
  },
  methods: {
    search() {
      // 分发事件
      this.$eventBus.$emit('search', this.searchName)
    }
  }
}
</script>

<style scoped>
</style>